<div class="headertitle">
	<span class="header">Forums</span>
</div>
<?php echo $this->Html->link("Add a new sub forum", array("controller" => "subforums", "action" => "add")); ?>

<?php echo $this->Form->Create(array("controller" => "forums", "action" => "delete")); ?>
<table cellpadding="0" cellspacing="0" id="subforumssortable">
	<thead>
		<tr>
			<th style="width: 1px"></th>
			<th style="width: 1px"></th>
			<th>Name</th>
			<th>Forum</th>
			<th>Role</th>
			<th>Created</th>
			<th>Modified</th>
			<th style="width: 1px">ID</th>
		</tr>
	</thead>
	<tbody>
	<?php foreach($subForums as $subForum): ?>
		<tr id="subforum_<?php echo $subForum['SubForum']['id']; ?>">
			<td><?php echo $this->Form->checkbox("selectedSubForums.", array("value" => $subForum['SubForum']['id'], "hiddenField" => false)); ?></td>
			<td><?php echo $this->Html->link($this->Html->image('icons/pencil.png'), array("controller" => "subforums", "action" => "edit/" . $subForum['SubForum']['id']), array("escape" => false)); ?></td>
			<td><?php echo $subForum['SubForum']['name']; ?></td>
			<td><?php echo $subForum['Forum']['name']; ?></td>
			<td><?php echo $roles[$subForum['SubForum']['role']]; ?></td>
			<td><?php echo $subForum['SubForum']['created']; ?></td>
			<td><?php echo $subForum['SubForum']['modified']; ?></td>
			<td><?php echo $subForum['SubForum']['id']; ?></td>
		</tr>
	<?php endforeach; ?>
	</tbody>
</table>
<?php echo $this->Form->End('Delete Selected'); ?>